home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / v / vrmenu.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  2.6 KB  |  100 lines

  1. VRMENU.MOD  (VR #2) --Makes choices pop up after letter.
  2. Vortex Rouge #163 @5853
  3. Thu, Dec 19, 1991   5:26 pm
  4. VRMENU.MOD
  5.  
  6. _____________________________________________________________________________
  7. Name      : VRMENU.MOD (Mod #2)  Description: In any menu you choose, this 
  8. Version   : 4.20                 Mod will output the routine after the letter
  9. Diffuculty: Easy                 IE: When a user hit's `D' it will print
  10.                  out `efaults' making it Defaults.
  11. _____________________________________________________________________________
  12. /* I started out thinking this would be an easy mod...but ran into some 
  13. problems with nl()'s...I traced the new lines back to function *mmkey(..)
  14. I forgot exacly where I took stuff out of *mmkey(..)...but it wasn't much
  15. Just replace  your orgional *mmkey with the *mmkey below.
  16.  
  17. /* FILE: bbsutil.c */
  18. /* Begin VRMENU.MOD Blockread */
  19. char *mmkey(int dl)
  20. {
  21.   static unsigned char cmd1[10],cmd2[81],ch;
  22.   int i,i1,i2,p;
  23.  
  24.   do {
  25.     do {
  26.       ch=getkey();
  27.     } while ((((ch<' ') && (ch!=13)) || (ch>126)) && (hangup==0));
  28.     ch=upcase(ch);
  29.     outchr(ch);
  30.     if (ch==13)
  31.       cmd1[0]=0;
  32.     else
  33.       cmd1[0]=ch;
  34.     cmd1[1]=0;
  35.     p=0;
  36.     switch(dl) {
  37.  
  38.     case 1:
  39.       if (strchr(dcd,ch)!=NULL)
  40.         p=1;
  41.       break;
  42.     case 2:
  43.       if (strchr(odc,ch)!=NULL)
  44.         p=1;
  45.       break;
  46.     case 0:
  47.       if (strchr(dc,ch)!=NULL)
  48.         p=1;
  49.       break;
  50.     }
  51.     if (p) {
  52.       do {
  53.         ch=getkey();
  54.       } while ((((ch<' ') && (ch!=13) && (ch!=8)) || (ch>126)) && (hangup==0));  /* This line and the above are one line. From }while to ==0)); */
  55.       ch=upcase(ch);
  56.       if (ch==13) {
  57.     nl();
  58.     return(cmd1);
  59.       } else
  60.         if (ch==8) {
  61.           backspace();
  62.         } else {
  63.           cmd1[1]=ch;
  64.           cmd1[2]=0;
  65.           outchr(ch);
  66.           if (ch=='/') {
  67.             input(cmd2,50);
  68.             return(cmd2);
  69.       } else
  70.         return(cmd1);
  71.     }
  72.     } else {
  73.       return(cmd1);
  74.     }
  75.   } while (hangup==0);
  76.   cmd1[0]=0;
  77.   return(cmd1);
  78. }
  79. /* End VRMENU.MOD Blockread */
  80.  
  81. OK, here comes the time consuming part.. in all your main menu cases, do 
  82. something like what was done below for defaults. If you have your prompt set
  83. on a different color than light blue, just chage the 1 in the prt statement
  84. to whatever number you wish. Just follow the below example, and you should
  85. be home free.
  86.  
  87.  
  88.  case 'D':
  89.     prt(1,"efaults");
  90.     helpl=4;
  91.     defaults();
  92.     break;
  93.  
  94.  
  95. If you have any questions/comments send them to me at:
  96.   1 @5899  (SUBBnet)
  97. 163 @5853  (WWIVnet)
  98.  91 @5801  (VBBSnet)
  99.      -=Insert Favorite Disclaimer Here=-
  100.             -Vorte